<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<title>密保问题设置</title>
		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../../../css/app.css">
		<style>
			body {
				background: #fff;
			}
			
			input {
				border-radius: 0!important;
				border: 0!important;
			}
			
			.newPet {
				width: 100%;
				height: 0.79rem !important;
				border: 0.01rem solid #e2e2e2 !important;
				border-left: none !important;
				border-right: none !important;
				outline: none;
				position: absolute;
				border-radius: 0!important;
				top: 0.66rem;
				left: 0;
				margin: 0 !important;
				font-size: 0.26rem;
			}
			
			input::-webkit-input-placeholder {
				font-size: 0.26rem;
				color: #cfcfcf;
			}
			
			.save {
				width: 6rem;
				height: 0.68rem;
				background: #117afd;
				font-size: 0.3rem;
				color: #fff;
				border: none;
				outline: none;
				position: absolute !important;
				top: 2.2rem !important;
				left: 0.75rem !important;
				border-radius: 0.1rem;
			}
		</style>
	</head>

	<body>
		<input type="password" id="oldpwd" class="mui-input-password mui-input-clear newPet" placeholder="请输入当前登录密码">
		<button class="save">下一步</button>
	</body>
	<script>
		function my_immersed() {

		}
	</script>
	<script src="../../../js/immersed.js"></script>
	<script src="../../../js/mui.min.js"></script>
	<script src="../../../js/common.js"></script>
	<script src="../../../js/app.js"></script>
	<script src="../../../js/md5.min.js" ></script>
	<script>
		document.querySelector('.save').addEventListener('tap', function() {
			var oldpwd = document.getElementById("oldpwd").value;
			if(oldpwd == '' || oldpwd == undefined || oldpwd.trim() == '') {
				mui.toast('当前登录密码不能为空');
			}else if(getUserId() == '' || getUserId() == undefined || getUserId().trim() == '') {
				mui.toast('请先登录再设置密保问题');
			} else {
				var param = "netUserId="+getUserId()+"&passWord=" +md5(oldpwd);
				utils.ajax('appUserInfo/valideQuestionPass.do', function(data) {
					var data = JSON.parse(data);
					if(data.state == '1') {
						var url = '_www/src/my/profile/security.html';
						showTemplates(url, '密保问题设置', url);
						mui.back();
					} else {
						mui.toast("当前登录密码验证不正确!");
					}
				}, param);
			}
		});
	</script>

</html>